package com.zhiyou.monitoring.controller;

import com.zhiyou.common.pojo.Result;
import com.zhiyou.common.pojo.StateCode;
import com.zhiyou.monitoring.pojo.VideoMonitoring;
import com.zhiyou.monitoring.service.VideoMonitoringService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/videoMonitoring")
public class VideoMonitoringController {
    @Autowired
    VideoMonitoringService videoMonitoringService;


    /**
     * 监控列表
     * @return
     */
    @GetMapping("/list")
    public Result  getAllMonitoringList(){

        List<VideoMonitoring> monitoringList = videoMonitoringService.getMonitoringList();
        return new Result(true, StateCode.OK,"查询成功",monitoringList);

    }

    /**
     * 监控设备详情
     * @param id
     * @return
     */

    @GetMapping("/details/{id}")
    public Result  getAllMonitoringdetails(@PathVariable String id){

        VideoMonitoring allMonitoringdetails = videoMonitoringService.getAllMonitoringdetails(id);
        return new Result(true, StateCode.OK,"查询成功",allMonitoringdetails);

    }



}
